import req from '../../utils/requestMock'
import request from '@/utils/request'
import type { TopListApi,AlbumInfoApi } from './model/topListModel'
import type {TopListRanksApi,CommentsApi} from './model/topListModelTo'
// 获取排行榜列表
export const getTopListApi = () => {
  return  req.get<any,TopListApi>(`/toplist/toplist`)
}
// 获取排行榜列表数据
// export const getRanksApi = ({topId,page,limit}:topListData) => {
//   return request.get<any,TopListRanksApi>(`getRanks/${topId}/${page}/${limit}`)
// }
export const getRanksApi = (topId:number) => {
  return request.get<any,TopListRanksApi>(`getRanks?topId=${topId}`)
}

// 获取评论
export const getCommentsApi = (id:number) => {
  return request.get<any,CommentsApi>(`getComments?id=${id}`)
  // return request.get<any,null>(`getComments`,{params:id})
}

// 获取专辑信息
export const getAlbumInfoApi = (id:string) => {
  return request.get<any,AlbumInfoApi>(`getAlbumInfo?albummid=${id}`)
}
